ADD_CUSTOM_TARGET(package)

SET(BTK_MODULES_LOCATION "")
IF(BTK_BUILD_SHARED_LIBS)
  FOREACH(lib ${BTK_LIBRARIES})
    GET_TARGET_PROPERTY(_LOC ${lib} LOCATION)
    SET(BTK_MODULES_LOCATION ${BTK_MODULES_LOCATION} ${_LOC})
  ENDFOREACH(lib)
ENDIF(BTK_BUILD_SHARED_LIBS)

IF(BTK_WRAP_MATLAB)
  ADD_CUSTOM_TARGET(Package_Matlab
                    COMMAND ${CMAKE_COMMAND} -D BTK_VERSION_STRING:STRING=${BTK_VERSION_STRING} -D BTK_BINARY_DIR:STRING=${BTK_BINARY_DIR} -D BTK_SOURCE_DIR:STRING=${BTK_SOURCE_DIR} -P "${BTK_SOURCE_DIR}/Packaging/Matlab/btkPackageMatlabBinding.cmake")
  ADD_DEPENDENCIES(package Package_Matlab)
ENDIF(BTK_WRAP_MATLAB)

IF(BTK_WRAP_OCTAVE)
  ADD_CUSTOM_TARGET(Package_Octave
                    COMMAND ${CMAKE_COMMAND} -D BTK_VERSION_STRING:STRING=${BTK_VERSION_STRING} -D BTK_BINARY_DIR:STRING=${BTK_BINARY_DIR} -D BTK_SOURCE_DIR:STRING=${BTK_SOURCE_DIR} -P "${BTK_SOURCE_DIR}/Packaging/Octave/btkPackageOctaveBinding.cmake")
  ADD_DEPENDENCIES(package Package_Octave)
ENDIF(BTK_WRAP_OCTAVE)

IF(BTK_WRAP_PYTHON)
  GET_TARGET_PROPERTY(BTK_SWIG_PYTHON_MODULE_LOCATION "_btk" LOCATION)
  ADD_CUSTOM_TARGET(Package_Python
                    COMMAND ${CMAKE_COMMAND} -D BTK_SWIG_PYTHON_MODULE_LOCATION:STRING=${BTK_SWIG_PYTHON_MODULE_LOCATION} -D ARCH_64_BIT:BOOL=${HAVE_64_BIT} -D BTK_VERSION_STRING:STRING=${BTK_VERSION_STRING} -D BTK_BINARY_DIR:STRING=${BTK_BINARY_DIR} -D BTK_SOURCE_DIR:STRING=${BTK_SOURCE_DIR} -P "${BTK_SOURCE_DIR}/Packaging/Python/btkPackagePythonBinding.cmake")
  ADD_DEPENDENCIES(package Package_Python)
ENDIF(BTK_WRAP_PYTHON)
